<?php
/**
 * Created by PhpStorm.
 * User: tt
 * Date: 2017/12/26
 * Time: 17:41
 */

namespace app\admin\controller;
use app\admin\logic\Yygroup as Yygroup_logic;
use think\Db;

class Yygroup extends Admin
{
    /**
     * 邀约列表
     * @return mixed
     * @internal
     */
    public function index(){
        $yygroup_logic = new Yygroup_logic();
        $yygroup = $yygroup_logic->getAllYygroup();
        $this->assign('yygroup',$yygroup);
        return $this->fetch();
    }

    /**
     * 添加邀约
     * @return mixed
     * @internal
     */
    public function add(){
        $depar = Db::name('depar')->field('id,title,pid')->select();
        $this->assign('depar',$depar);
        $data = $this->request->param();
        if($this->request->isPost()){
            dump($data);
            Db::name('yygroup')->insert($data);

        }
        return $this->fetch();
    }

}